<?php /* Smarty version Smarty-3.1.8, created on 2019-07-16 20:14:24
         compiled from "/Users/aron/GitRepos/PHPBroShop/broshop/home/views/default/user/register.html" */ ?>
<?php /*%%SmartyHeaderCode:17795873985d2dbfa0c51273-45201644%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '43613e3caf8605dd7d2d9ff436e33c42e3473c0d' => 
    array (
      0 => '/Users/aron/GitRepos/PHPBroShop/broshop/home/views/default/user/register.html',
      1 => 1450315300,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '17795873985d2dbfa0c51273-45201644',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'url' => 0,
    'public' => 0,
    'app' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_5d2dbfa0cbe4e1_20657127',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5d2dbfa0cbe4e1_20657127')) {function content_5d2dbfa0cbe4e1_20657127($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("public/header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


	<!-- content -->


<div class="width980">
	<div class="loginbox registbox">
		<div class="logintt">用户注册</div>
		<form method="post" action="<?php echo $_smarty_tpl->tpl_vars['url']->value;?>
&a=register" id="form"  onsubmit="return validate('click')">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="regist_table">
		<tr>
			<td width="15%" align="right">用户名:</td>
			<td width="33%"><input type="text" name="name" class="input1" /></td>
			<td width="52%"><span id="name" class="stats1">由5-15位字符组成（可以是字母、汉字、数字）</span></td>
		</tr>
		<tr>
			<td align="right">密码:</td>
			<td><input type="password" name="pw" class="input1" /></td>
			<td><span  id="pw" class="stats1">密码由6-16个字符组成!</span></td>
		</tr>
		<tr>
			<td align="right">确认密码:</td>
			<td><input type="password" name="pw1" class="input1" /></td>
			<td><span id="pw1" class="stats1">和上面的密码一致</span></td>
		</tr>
		<tr>
			<td align="right">邮箱:</td>
			<td><input type="text" name="email" class="input1" /></td>
			<td><span id="email" class="stats1">请填写您的常用邮箱，以方便与您联系</span></td>
		</tr>
		<tr>
			<td align="right"></td>
			<td>
				<input type="submit" class="btn_05" value="立即注册"  name="do_submit" style="margin:0" /></td>
			<td></td>
		</tr>
		</table>
		
		</form>
	</div>
</div>
<script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['public']->value;?>
/js/ajax3.0.js"></script>
<script type="text/javascript">
var rclick=null;
function notnull(val){
	return val.match(/^\S+$/) ? true : false;
}


//设置三种状态
function setStats(objstr,mess,check) {
	obj = document.getElementsByName(objstr)[0];
	
	
	
	obj.onfocus=function(){
		cobj = document.getElementById(objstr);
		cobj.className="stats1";
		cobj.innerHTML=mess;
		
	}

	
	obj.onblur=function(){	
		cobj = document.getElementById(objstr);
		info=check(this.value, mess);
		if(info[0]){
			cobj.className="stats2";
			cobj.innerHTML="输入正确";	
		}else{
			cobj.className="stats3";
			cobj.innerHTML=info[1];
			
		} 
	}

	if(rclick=='click')
		obj.onblur();

}
//加载时用
window.onload=validate;
//点注册时使用
function validate(click){
	if(click)
		rclick=click;		

	var fg=true;
	
		
	setStats("name", '由5-15位字符组成（可以是字母、汉字、数字）',function(val, mess){
		var info=[false, mess];	
		if(notnull(val) && val.length >=5 && val.length <=15 ){
			Ajax('html',false).get("<?php echo $_smarty_tpl->tpl_vars['app']->value;?>
?m=user&a=register&name="+val, function(data){
				
				info[0]=eval(data);	
			
				if(!info[0]){
					info[1]="用户 "+val+" 已经存在";
					fg=false;
				}
			
			})	
		}else{
			fg=false;
		}
	
		return info;

	});

	setStats("pw",'密码由6-16个字符组成!', function(val, mess){
		var info=[false, mess];
		if(notnull(val) && val.length >=6 && val.length <=16 ){
			info[0]=true;
		}else{
			fg=false;
		}
		return info;
	});

	setStats("pw1",'和上面输入的密码要一致!',function(val, mess){
		var userpwd = document.getElementsByName('pw')[0];
		var info=[false, mess];
		if(val==userpwd.value && val.length >= 6  && val.length <=16 ){
			info[0]=true;	
		}else{
			fg=false;
		}
		return info;
	});

	setStats("email", '请填写您的常用邮箱，以方便与您联系!', function(val, mess){
		var info=[false, mess];		

		if(val.match(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/)){
			info[0]=true;	
		}else{
			fg=false;
		}
		return info;
	});
	
	if(click=='click')
		return fg;
}
</script>
<!--content End--> 


	<!-- footer -->
<?php echo $_smarty_tpl->getSubTemplate ("public/footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php }} ?>